﻿using System.Collections.Generic;
using System.Runtime.Serialization;
using MyFloridaHouse.libSvDTO;

namespace MyFloridaHouse.libSTO
{
	/// <summary>
	/// District Shape STO (server transfer object)
	/// </summary>
    [DataContract]
    public class DistrictShapeSTO
    {
        //TODO: Remove _geometryCOmbined when conversion from WKT is complete and table storage branch is merged  back in
        DistrictShapeDTO _geometryCombined;
        int _districtID;
        List<BoundingBoxDTO> _districtSubShapeList;
        List<BoundingBoxDTO> _districtHolesList;
        BoundingBoxDTO _districtShapeBoundingBox;
        PointDTO _centerPoint;
        MapMultiShapeDTO _mapMultiShapeDTO;
        

        bool _hasInteriorRing;
        string _errorMessage;

		/// <summary>
		/// Initializes a new instance of the <see cref="DistrictShapeSTO"/> class.
		/// </summary>
        public DistrictShapeSTO()
        {
            _districtID = -1;
            _errorMessage = "";
            _districtSubShapeList = new List<BoundingBoxDTO>();
            _districtHolesList = new List<BoundingBoxDTO>();
            _districtShapeBoundingBox = new BoundingBoxDTO();
            _centerPoint = new PointDTO();
            _hasInteriorRing = true;
            _geometryCombined = new DistrictShapeDTO();
            _mapMultiShapeDTO = null;
        }

        /// <summary>
        /// Gets or sets the geometry combined.
        /// </summary>
        /// <value>The geometry combined.</value>
        [DataMember]
        public DistrictShapeDTO geometryCombined
        {
            get { return _geometryCombined; }
            set { _geometryCombined = value; }
        }

		/// <summary>
		/// Gets or sets the district ID.
		/// </summary>
		/// <value>The district ID.</value>
        [DataMember]
        public int districtID
        {
            get { return _districtID; }
            set { _districtID = value; }
        }

		/// <summary>
		/// Gets or sets the district sub shape list.
		/// </summary>
		/// <value>The district sub shape list.</value>
        [DataMember]
        public List<BoundingBoxDTO> districtSubShapeList
        {
            get { return _districtSubShapeList; }
            set { _districtSubShapeList = value; }
        }

		/// <summary>
		/// Gets or sets the district holes list.
		/// </summary>
		/// <value>The district holes list.</value>
        [DataMember]
        public List<BoundingBoxDTO> districtHolesList
        {
            get { return _districtHolesList; }
            set { _districtHolesList = value; }
        }

        /// <summary>
        /// Gets or sets the district shape bounding box.
        /// </summary>
        /// <value>The district shape bounding box.</value>
        [DataMember]
        public BoundingBoxDTO districtShapeBoundingBox
        {
            get { return _districtShapeBoundingBox; }
            set { _districtShapeBoundingBox = value; }
        }

        /// <summary>
        /// Gets or sets the district center point.
        /// </summary>
        /// <value>The district shape center point.</value>
        [DataMember]
        public PointDTO centerPoint
        {
            get { return _centerPoint; }
            set { _centerPoint = value; }
        }

		/// <summary>
		/// Gets or sets a value indicating whether this instance has interior ring.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this instance has interior ring; otherwise, <c>false</c>.
		/// </value>
        [DataMember]
        public bool hasInteriorRing
        {
            get { return _hasInteriorRing; }
            set { _hasInteriorRing = value; }
        }


		/// <summary>
		/// Gets or sets the error message.
		/// </summary>
		/// <value>The error message.</value>
        [DataMember]
        public string errorMessage
        {
            get { return _errorMessage; }
            set { _errorMessage = value; }
        }

        [DataMember]
        public MapMultiShapeDTO mapMultiShapeDTO
        {
            get { return _mapMultiShapeDTO; }
            set { _mapMultiShapeDTO = value; }
        }
    }
}
